#ifndef __USER_FLASH_
#define __USER_FLASH_

#include "main.h"

#define APP_ADD        (uint32_t)0x08001800    //APP开始地址
#define LAST_PAGE_ADD  (uint32_t)0x08003c00    //单片机最后一页地址
#define FLASH_PAGE_SIZE      0x400      /* 1 Kbytes */
#define FLASH_END_ADD   0x08003FFF

#define UPDATA_FLAG_ADD      0X08003998   //改地址用来存放升级标志

void flashUnlock(void);
void flashLock(void);
void flashInit(void);
void flashErasePage(uint32_t pAdd);
void flashAppErase(void);
void flashWriteHalfWord(uint32_t address,uint16_t data);
void flashAppWrite(__IO uint32_t address,uint16_t* data,uint16_t len);


#endif

